﻿<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="welcome.aspx.cs" Inherits="welcome" %>


<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
    <title>会员管理</title>
    <!-- iCheck -->
    <link href="/reference/plugins/iCheck/all.css" rel="stylesheet" />
    <!-- select2 -->
    <link href="/reference/plugins/select2/select2.min.css" rel="stylesheet" />
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder" runat="Server">
    <section class="content-header">
        <h1>会员管理
            <small>系统设置</small>
        </h1>
        <ol class="breadcrumb">
            <li><a><i class="fa fa-dashboard"></i>主页</a></li>
            <li><a href="userManager.aspx">系统设置</a></li>
            <li class="active">会员管理</li>
        </ol>
    </section>

    <section class="content">

        <div class="box box-primary">
            <div class="box-header with-border">
                <div>
                    <div class="box-tools pull-left">
                        <button type="button" class="btn btn-primary" data-toggle="modal" data-target="#userManager" data-action="add">添加用户</button>
                    </div>
                </div>
            </div>
            <div class="box-body">
                <table id="userManagerList" class="table table-bordered table-striped">
                    <thead>
                        <tr>
                            <th class="col-sm-2">姓名</th>
                            <th class="col-sm-3">账号</th>
                            <th class="col-sm-1">可用</th>
                            <th>操作</th>

                        </tr>
                    </thead>
                    <tbody>
                       
                    </tbody>
                </table>
            </div>
 

        
            <div>
                <input type="text" id="rolesign" runat="server" />
            </div>
        </div>
    </section>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ScriptPlaceHolder" runat="Server">
    <!-- iCheck -->
    <script src="/reference/plugins/iCheck/icheck.js"></script>
    <!-- select2 -->
    <script src="/reference/plugins/select2/select2.full.min.js"></script>
    <script src="/reference/plugins/select2/i18n/zh-CN.js"></script>
    <script type="text/javascript">
        var prm = Sys.WebForms.PageRequestManager.getInstance();
        prm.add_endRequest(function () {
            // re-bind your jquery events here   

            $(document).ready(function () {
                $('#ContentPlaceHolder_selEditPwd').iCheck({
                    checkboxClass: 'icheckbox_square-blue',
                    radioClass: 'iradio_square-blue'
                });

                //iCheckChange();
                $('.select2').select2({
                    language: "zh-CN"
                });
            });
        }
       );
    </script>
    <script>
        $(document).ready(function () {
            $('#ContentPlaceHolder_selEditPwd').iCheck({
                checkboxClass: 'icheckbox_square-blue',
                radioClass: 'iradio_square-blue'
            });

            //iCheckChange();

            $('.select2').select2({
                language: "zh-CN"
            });
        });

        $('#userRole').on('show.bs.modal', function (event) {
            var button = $(event.relatedTarget)

            var action = button.data('action');
            $("#userManagerLabel").text("设置权限");
            var browserID = button.data('bid');
            $("#ContentPlaceHolder_hidBID1").val(browserID);

            $("#ContentPlaceHolder_btnGetRole").click();

        })









        function deleteuserManager(mlID) {
            var f = confirm("确定要删除此用户吗?");
            if (f == true) {
                $("#ContentPlaceHolder_hidBID").val(mlID);
                $("#ContentPlaceHolder_btnDelete").click();
            }
        }

        $('#userManager').on('show.bs.modal', function (event) {
            var button = $(event.relatedTarget)

            var action = button.data('action');
            if (action == "add") {
                $("#userManagerLabel").text("添加用户");
                $("#ContentPlaceHolder_btnSave").css("display", "");
                $("#ContentPlaceHolder_btnUpdate").css("display", "none");
                $(".editPwd").css("display", "none");

                $("#ContentPlaceHolder_txtName").val("");
                $("#ContentPlaceHolder_txtAccount").val("");
                $("#ContentPlaceHolder_txtPwd").val("");
                $("#ContentPlaceHolder_ddlIsUsing").val("1");
            }
            else if (action == "update") {
                $("#userManagerLabel").text("修改用户");
                $("#ContentPlaceHolder_btnSave").css("display", "none");
                $("#ContentPlaceHolder_btnUpdate").css("display", "");
                $(".editPwd").css("display", "");

                var browserID = button.data('bid');
                $("#ContentPlaceHolder_hidBID").val(browserID);
                $("#ContentPlaceHolder_btnGet").click();
            }
        })


        function SetCheak(productid, sign, obj) {
            var midstr = productid + "|" + sign + "@";
            if (sign == "I") {
                if (obj.checked == true) {

                    $("#ContentPlaceHolder_rolesign").val($("#ContentPlaceHolder_rolesign").val() + midstr);
                }
                else {
                    $("#ContentPlaceHolder_rolesign").val($("#ContentPlaceHolder_rolesign").val().replace(midstr, ""));
                }
            }
            else {
                if (obj.checked == false) {

                    $("#ContentPlaceHolder_rolesign").val($("#ContentPlaceHolder_rolesign").val() + midstr);
                }
                else {
                    $("#ContentPlaceHolder_rolesign").val($("#ContentPlaceHolder_rolesign").val().replace(midstr, ""));
                }
            }
        }


    </script>
</asp:Content>


